//
//  JWTLoginCoverView.m
//  JWT
//
//  Created by ndm on 17/2/11.
//  Copyright © 2017年 com.jwtsoft. All rights reserved.
//

#import "JWTLoginCoverView.h"
#import "JWTLoginViewController.h"

@implementation JWTLoginCoverView

SHARED_INSTANCE_IMPLEMENTATION(JWTLoginCoverView);

-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame] ;
    if (self) {
        self.frame = CGRectMake(0, 0, UISCREEN_WIDTH, UISCREEN_HEIGHT-108);
        self.backgroundColor = RGBA(0, 0, 0, 0.5);
        
        UIButton *loginButton = [[UIButton alloc] init];
        loginButton.frame = CGRectMake(UISCREEN_WIDTH * 0.25, UISCREEN_HEIGHT*0.4, UISCREEN_WIDTH-UISCREEN_WIDTH * 0.5, 64);
        [loginButton setTitle:@"立即登录" forState:UIControlStateNormal];
        [loginButton setTitleColor:RGB_WhiteBackGround forState:UIControlStateNormal];
        loginButton.backgroundColor = HeaderBackground_Color;
        [loginButton addTarget:self action:@selector(pushToLogin) forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:loginButton];
        loginButton.center = CGPointMake(loginButton.center.x, self.height*0.5);
    }
    return self;
}

-(void)pushToLogin{
    [self removeFromSuperview];
    JWTLoginViewController *loginVC = [[JWTLoginViewController alloc] init];
    [[[JWTAppTabBarTheme sharedInstance] getNavController] pushViewController:loginVC animated:YES];
}


@end
